Package housekeeping: fix bundler compatibility, standardize on npm, add Dependabot#128
Open
nachogarcia wants to merge 1 commit intoronkok:mainfrom
Open
Package housekeeping: fix bundler compatibility, standardize on npm, add Dependabot#128nachogarcia wants to merge 1 commit intoronkok:mainfrom
nachogarcia wants to merge 1 commit intoronkok:mainfrom
Conversation
…endabot - Add sideEffects: true to fix Vite/esbuild tree-shaking away defineSymbol calls - Remove yarn (yarn.lock, .yarnrc.yml, packageManager field) - Replace yarn with npm run in scripts, add prepublishOnly script - Remove dead esm dependency, fix git:// repo URL to https:// - Add dist/ to .gitignore, ensure copyfiles.js creates dist/ on fresh clone - Add .github/dependabot.yml for weekly npm updates - Remove dist/ from git tracking (build artifacts via npm run dist)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #127
Package housekeeping: fix bundler compatibility, standardize on npm, add Dependabot
Summary
"sideEffects": trueto fix Vite/esbuild breaking Temml (#sideeffects)packageManagerfield (#lockfiles)esmdependency, fix deprecatedgit://repository URL (#dependencies)dist/to.gitignore— build artifacts shouldn't be version-controlled (#dist-tracked)Changes
Fix:
sideEffects: truein package.jsonTemml breaks when pre-bundled by Vite (esbuild) because the ~1,061
defineSymbol()anddefineMacro()calls are treated as dead code and removed. Adding"sideEffects": truetells bundlers to preserve module-level initialization code.A granular approach (
"sideEffects": ["src/symbols.js", "src/macros.js"]) would not work because consumers resolve to the pre-builtdist/temml.mjs— a single bundle where those source paths don't exist as separate modules.Standardize on npm
yarn.lockand.yarnrc.yml"packageManager": "yarn@3.3.1"from package.jsonyarnwithnpm runin all scripts (test,build,dist)package-lock.jsonwith a cleannpm installnpm ships with Node.js, requires no extra setup, and is what most contributors expect.
Remove dead dependency and fix repository URL
esmfrom devDependencies — it is never imported anywhere in the codebasegit://(disabled by GitHub since 2022) tohttps://Add dist/ to .gitignore
The 13 files in
dist/are all generated bynpm run dist. Tracking them inflates the repo and creates noisy diffs. npm publishing still works becausedist/is in the"files"field.Also cleaned up stale Yarn PnP entries from
.gitignore(.yarn/,.pnp.*).Ran
git rm --cached -r dist/to stop tracking the existing files. AprepublishOnlyscript was added sonpm publishautomatically runsnpm run distfirst, guaranteeing fresh build artifacts in every release.Since
dist/no longer exists on a fresh clone, addedfs.mkdirSync('dist', { recursive: true })toutils/copyfiles.jssonpm run distcreates it automatically.Add Dependabot
Added
.github/dependabot.ymlfor weekly npm dependency update PRs.Files changed
package.jsonsideEffects, removeesm/packageManager, fix URL,npm runscripts,prepublishOnlyutils/copyfiles.jsdist/directory if missing.gitignoredist/, remove stale Yarn entries.github/dependabot.ymlyarn.lock.yarnrc.ymlpackage-lock.jsonNot included (suggest as follow-ups)
eslint9→10,@eslint/js9→10,globals15→17 (breaking changes, should be separate PRs)site/directory (339 tracked files): Likely used for GitHub Pages — separate discussionTest plan
npm installsucceeds cleanlynpm testpasses (lint + unit tests)npm run buildproduces correct output intest/andutils/npm run distcopies artifacts todist/correctlyimport temml from 'temml'renders math correctly